package com.lock.demo.mysql.mapper;

import com.lock.demo.mysql.entity.LockRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @ProjectName: lock_demo
 * @Package: com.lock.demo.mysql.mapper
 * @Author: huat
 * @Date: 2021/5/4 14:11
 * @Version: 1.0
 */
@Mapper
public interface LockMapper {
    /**
     * 查询有没有线程获取锁
     * @param lockName
     * @return
     */
    LockRecord getLockName(@Param("lockName") String lockName);
    /**
     * 新增锁
     */
    int insertLockName(@Param("lockName") String lockName);

    /**
     * 删除锁
     * @param lockName
     * @return
     */
    int deleteLockName(@Param("lockName") String lockName);
}
